import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
public class JavaIO {
	public static void main(String[] args) {
		int i=1;
		BufferedReader br = null;
		FileWriter fw = null;
		try {
			br = new BufferedReader(new FileReader("F:\\Java projects\\Java-Course\\src\\JavaIO.java"));
			fw = new FileWriter("D:\\IO.txt");
			String result = null;
			while ((result = br.readLine())!= null) {
				System.out.print(i+":"+"\t"+result+"\n");
				fw.write(i+":"+"\t"+result+"\n");
				i++;
			}
		} catch (Exception e1) {
			e1.printStackTrace();
		}finally {
			try {
				br.close();
				fw.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}
}
